package cn.kpi.service.attendance.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.kpi.dao.attendance.AttRoutineDao;
import cn.kpi.entity.attendance.AttRoutineEntity;
import cn.kpi.service.attendance.IAttRoutineService;

@Service
public class AttRoutineServiceImpl implements IAttRoutineService {
	@Autowired
	private AttRoutineDao attRoutineDao;
	
	public List<AttRoutineEntity> GetAttRoutineListByWhere(String where) throws Exception{
		try{
			return attRoutineDao.GetAttRoutineListByWhere(where);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return null;
		}
	}

	public int GetAttRoutineListCountByWhere(String where) throws Exception{
		try{
			return attRoutineDao.GetAttRoutineListCountByWhere(where);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return -1;
		}
	}

	public int InsertAttRoutine(AttRoutineEntity entity) throws Exception{
		try{
			return attRoutineDao.InsertAttRoutine(entity);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return -1;
		}
	}

	public int UpdateAttRoutine(AttRoutineEntity entity) throws Exception{
		try{
			return attRoutineDao.UpdateAttRoutine(entity);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return -1;
		}
	}

	public int DeteleAttRoutine(Long routineid) throws Exception{
		try{
			return attRoutineDao.DeteleAttRoutine(routineid);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return -1;
		}
	}
	public AttRoutineEntity GetAttRoutineListById(Long routineid) throws Exception{
		try{
			return attRoutineDao.GetAttRoutineListById(routineid);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return null;
		}
	}
}
